/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ch.centrisag;

/**
 * Ermittelt die Spalten-Nummer aus dem Spalten-Buchstaben
 * @author Patrick Wachsmuth
 * @version 1.0
 */
public class ColumnToValue {

    /**
     * Ermittelt die Spalten-Nummer aus dem übergebenen Spalten-Buchstaben
     * @param columnName
     * @return column-Number
     */
    public int getValueFromColumnName(String columnName) {
        int result = 0;

        switch (columnName) {
            case "A":
                result = 1;
                break;
            case "B":
                result = 2;
                break;
            case "C":
                result = 3;
                break;
            case "D":
                result = 4;
                break;
            case "E":
                result = 5;
                break;
            case "F":
                result = 6;
                break;
            case "G":
                result = 7;
                break;
            case "H":
                result = 8;
                break;
            case "I":
                result = 9;
                break;
            case "J":
                result = 10;
                break;
            case "K":
                result = 11;
                break;
            case "L":
                result = 12;
                break;
            case "M":
                result = 13;
                break;
            case "N":
                result = 14;
                break;
            case "O":
                result = 15;
                break;
            case "P":
                result = 16;
                break;
            case "Q":
                result = 17;
                break;
            case "R":
                result = 18;
                break;
            case "S":
                result = 19;
                break;
            case "T":
                result = 20;
                break;
            case "U":
                result = 21;
                break;
            case "V":
                result = 22;
                break;
            case "W":
                result = 23;
                break;
            case "X":
                result = 24;
                break;
            case "Y":
                result = 25;
                break;
            case "Z":
                result = 26;
                break;
            case "AA":
                result = 27;
                break;
            case "AB":
                result = 28;
                break;
            case "AC":
                result = 29;
                break;
            case "AD":
                result = 30;
                break;
            case "AE":
                result = 31;
                break;
            case "AF":
                result = 32;
                break;
            case "AG":
                result = 33;
                break;
            case "AH":
                result = 34;
                break;
            case "AI":
                result = 35;
                break;
            case "AJ":
                result = 36;
                break;
            case "AK":
                result = 37;
                break;
            case "AL":
                result = 38;
                break;
            case "AM":
                result = 39;
                break;
            case "AN":
                result = 40;
                break;
            case "AO":
                result = 41;
                break;
            case "AP":
                result = 42;
                break;
            case "AQ":
                result = 43;
                break;
            case "AR":
                result = 44;
                break;
            case "AS":
                result = 45;
                break;
            case "AT":
                result = 46;
                break;
            case "AU":
                result = 47;
                break;
            case "AV":
                result = 48;
                break;
            case "AW":
                result = 49;
                break;
            case "AX":
                result = 50;
                break;
            case "AY":
                result = 51;
                break;
            case "AZ":
                result = 52;
                break;
            default:
                result = -99999;
                break;
        }

        return result;
    }
}
